var isFullScreen = function (document) {
    return document.isFullScreen || document.mozIsFullScreen || document.webkitIsFullScreen
}
var Fullscreen = function (self) {
    var docElm = document.documentElement;
    if(self==null){
        return isFullScreen(document)
    }
    if (!isFullScreen(document)) {
        try {
            if (docElm.requestFullscreen) {
                docElm.requestFullscreen();
            } else if (docElm.mozRequestFullScreen) {
                docElm.mozRequestFullScreen();
            } else if (docElm.webkitRequestFullScreen) {
                docElm.webkitRequestFullScreen();
            } else if (elem.msRequestFullscreen) {
                elem.msRequestFullscreen();
            }
            self.fullscre = !self.fullscre;
        } catch (exception) {

        } finally {

        }
    } else {
        try {
            if (document.exitFullscreen) {
                document.exitFullscreen();
            } else if (document.mozCancelFullScreen) {
                document.mozCancelFullScreen();
            } else if (document.webkitCancelFullScreen) {
                document.webkitCancelFullScreen();
            } else if (document.msExitFullscreen) {
                document.msExitFullscreen();
            }
            self.fullscre = !self.fullscre;
        } catch (exception) {

        } finally {

        }

    }

    setTimeout(() => {
        self.$ResizePool.Run();
    }, 200);
    return  self.fullscre
}

 module.exports =  Fullscreen